<!DOCTYPE html><html lang="zh-CN" data-theme="light"><head><meta charset="UTF-8"><meta http-equiv="X-UA-Compatible" content="IE=edge"><meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0"><title>hexo头像无法显示 | Blog</title><meta name="author" content="Leyandh"><meta name="copyright" content="Leyandh"><meta name="format-detection" content="telephone=no"><meta name="theme-color" content="#ffffff"><meta name="description" content="进入themes路径下的layout&#x2F;_partial&#x2F;找到你的hexo主题themes路径下的layout&#x2F;_partial&#x2F;left-col.ejs，如下图 修改left-col.ejs直接修改layout&#x2F;_partial&#x2F;left-col.ejs的第六行和第八行为： 12&lt;img src&#x3D;&quot;&lt;%&#x3D;theme.">
<meta property="og:type" content="article">
<meta property="og:title" content="hexo头像无法显示">
<meta property="og:url" content="http://leyandh.gitee.io/2023/03/22/hexo%E5%A4%B4%E5%83%8F%E6%97%A0%E6%B3%95%E6%98%BE%E7%A4%BA/index.html">
<meta property="og:site_name" content="Blog">
<meta property="og:description" content="进入themes路径下的layout&#x2F;_partial&#x2F;找到你的hexo主题themes路径下的layout&#x2F;_partial&#x2F;left-col.ejs，如下图 修改left-col.ejs直接修改layout&#x2F;_partial&#x2F;left-col.ejs的第六行和第八行为： 12&lt;img src&#x3D;&quot;&lt;%&#x3D;theme.">
<meta property="og:locale" content="zh_CN">
<meta property="og:image" content="https://leyandh.gitee.io/img/maqima.jpg">
<meta property="article:published_time" content="2023-03-22T15:24:30.000Z">
<meta property="article:modified_time" content="2023-04-06T15:42:30.618Z">
<meta property="article:author" content="Leyandh">
<meta property="article:tag" content="hexo">
<meta name="twitter:card" content="summary">
<meta name="twitter:image" content="https://leyandh.gitee.io/img/maqima.jpg"><link rel="shortcut icon" href="https://leyandh.gitee.io/img/maqima.jpg"><link rel="canonical" href="http://leyandh.gitee.io/2023/03/22/hexo%E5%A4%B4%E5%83%8F%E6%97%A0%E6%B3%95%E6%98%BE%E7%A4%BA/index.html"><link rel="preconnect" href="//cdn.jsdelivr.net"/><link rel="preconnect" href="//busuanzi.ibruce.info"/><link rel="stylesheet" href="/css/index.css"><link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@fortawesome/fontawesome-free/css/all.min.css" media="print" onload="this.media='all'"><link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@fancyapps/ui/dist/fancybox.min.css" media="print" onload="this.media='all'"><script>const GLOBAL_CONFIG = { 
  root: '/',
  algolia: undefined,
  localSearch: undefined,
  translate: undefined,
  noticeOutdate: undefined,
  highlight: {"plugin":"highlighjs","highlightCopy":true,"highlightLang":true,"highlightHeightLimit":false},
  copy: {
    success: '复制成功',
    error: '复制错误',
    noSupport: '浏览器不支持'
  },
  relativeDate: {
    homepage: false,
    post: false
  },
  runtime: '',
  date_suffix: {
    just: '刚刚',
    min: '分钟前',
    hour: '小时前',
    day: '天前',
    month: '个月前'
  },
  copyright: undefined,
  lightbox: 'fancybox',
  Snackbar: undefined,
  source: {
    justifiedGallery: {
      js: 'https://cdn.jsdelivr.net/npm/flickr-justified-gallery/dist/fjGallery.min.js',
      css: 'https://cdn.jsdelivr.net/npm/flickr-justified-gallery/dist/fjGallery.min.css'
    }
  },
  isPhotoFigcaption: false,
  islazyload: false,
  isAnchor: false,
  percent: {
    toc: true,
    rightside: false,
  }
}</script><script id="config-diff">var GLOBAL_CONFIG_SITE = {
  title: 'hexo头像无法显示',
  isPost: true,
  isHome: false,
  isHighlightShrink: false,
  isToc: true,
  postUpdate: '2023-04-06 23:42:30'
}</script><noscript><style type="text/css">
  #nav {
    opacity: 1
  }
  .justified-gallery img {
    opacity: 1
  }

  #recent-posts time,
  #post-meta time {
    display: inline !important
  }
</style></noscript><script>(win=>{
    win.saveToLocal = {
      set: function setWithExpiry(key, value, ttl) {
        if (ttl === 0) return
        const now = new Date()
        const expiryDay = ttl * 86400000
        const item = {
          value: value,
          expiry: now.getTime() + expiryDay,
        }
        localStorage.setItem(key, JSON.stringify(item))
      },

      get: function getWithExpiry(key) {
        const itemStr = localStorage.getItem(key)

        if (!itemStr) {
          return undefined
        }
        const item = JSON.parse(itemStr)
        const now = new Date()

        if (now.getTime() > item.expiry) {
          localStorage.removeItem(key)
          return undefined
        }
        return item.value
      }
    }
  
    win.getScript = url => new Promise((resolve, reject) => {
      const script = document.createElement('script')
      script.src = url
      script.async = true
      script.onerror = reject
      script.onload = script.onreadystatechange = function() {
        const loadState = this.readyState
        if (loadState && loadState !== 'loaded' && loadState !== 'complete') return
        script.onload = script.onreadystatechange = null
        resolve()
      }
      document.head.appendChild(script)
    })
  
    win.getCSS = (url,id = false) => new Promise((resolve, reject) => {
      const link = document.createElement('link')
      link.rel = 'stylesheet'
      link.href = url
      if (id) link.id = id
      link.onerror = reject
      link.onload = link.onreadystatechange = function() {
        const loadState = this.readyState
        if (loadState && loadState !== 'loaded' && loadState !== 'complete') return
        link.onload = link.onreadystatechange = null
        resolve()
      }
      document.head.appendChild(link)
    })
  
      win.activateDarkMode = function () {
        document.documentElement.setAttribute('data-theme', 'dark')
        if (document.querySelector('meta[name="theme-color"]') !== null) {
          document.querySelector('meta[name="theme-color"]').setAttribute('content', '#0d0d0d')
        }
      }
      win.activateLightMode = function () {
        document.documentElement.setAttribute('data-theme', 'light')
        if (document.querySelector('meta[name="theme-color"]') !== null) {
          document.querySelector('meta[name="theme-color"]').setAttribute('content', '#ffffff')
        }
      }
      const t = saveToLocal.get('theme')
    
          if (t === 'dark') activateDarkMode()
          else if (t === 'light') activateLightMode()
        
      const asideStatus = saveToLocal.get('aside-status')
      if (asideStatus !== undefined) {
        if (asideStatus === 'hide') {
          document.documentElement.classList.add('hide-aside')
        } else {
          document.documentElement.classList.remove('hide-aside')
        }
      }
    
    const detectApple = () => {
      if(/iPad|iPhone|iPod|Macintosh/.test(navigator.userAgent)){
        document.documentElement.classList.add('apple')
      }
    }
    detectApple()
    })(window)</script><meta name="generator" content="Hexo 6.3.0"></head><body><div id="web_bg"></div><div id="sidebar"><div id="menu-mask"></div><div id="sidebar-menus"><div class="avatar-img is-center"><img src="https://leyandh.gitee.io/img/maqima.jpg" onerror="onerror=null;src='/img/friend_404.gif'" alt="avatar"/></div><div class="sidebar-site-data site-data is-center"><a href="/archives/"><div class="headline">文章</div><div class="length-num">10</div></a><a href="/tags/"><div class="headline">标签</div><div class="length-num">10</div></a><a href="/categories/"><div class="headline">分类</div><div class="length-num">0</div></a></div><hr/></div></div><div class="post" id="body-wrap"><header class="post-bg" id="page-header"><nav id="nav"><span id="blog-info"><a href="/" title="Blog"><span class="site-name">Blog</span></a></span><div id="menus"><div id="toggle-menu"><a class="site-page" href="javascript:void(0);"><i class="fas fa-bars fa-fw"></i></a></div></div></nav><div id="post-info"><h1 class="post-title">hexo头像无法显示</h1><div id="post-meta"><div class="meta-firstline"><span class="post-meta-date"><i class="far fa-calendar-alt fa-fw post-meta-icon"></i><span class="post-meta-label">发表于</span><time class="post-meta-date-created" datetime="2023-03-22T15:24:30.000Z" title="发表于 2023-03-22 23:24:30">2023-03-22</time><span class="post-meta-separator">|</span><i class="fas fa-history fa-fw post-meta-icon"></i><span class="post-meta-label">更新于</span><time class="post-meta-date-updated" datetime="2023-04-06T15:42:30.618Z" title="更新于 2023-04-06 23:42:30">2023-04-06</time></span></div><div class="meta-secondline"><span class="post-meta-separator">|</span><span class="post-meta-pv-cv" id="" data-flag-title="hexo头像无法显示"><i class="far fa-eye fa-fw post-meta-icon"></i><span class="post-meta-label">阅读量:</span><span id="busuanzi_value_page_pv"><i class="fa-solid fa-spinner fa-spin"></i></span></span></div></div></div></header><main class="layout" id="content-inner"><div id="post"><article class="post-content" id="article-container"><h1 id="进入themes路径下的layout-x2F-partial-x2F"><a href="#进入themes路径下的layout-x2F-partial-x2F" class="headerlink" title="进入themes路径下的layout&#x2F;_partial&#x2F;"></a>进入themes路径下的layout&#x2F;_partial&#x2F;</h1><p>找到你的hexo主题themes路径下的layout&#x2F;_partial&#x2F;left-col.ejs，如下图<br><img src="/../img/hexo/01.png" alt="avatar"></p>
<h1 id="修改left-col-ejs"><a href="#修改left-col-ejs" class="headerlink" title="修改left-col.ejs"></a>修改left-col.ejs</h1><p>直接修改layout&#x2F;_partial&#x2F;left-col.ejs的第六行和第八行为：</p>
<figure class="highlight js"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><span class="line">&lt;img src=<span class="string">&quot;&lt;%=theme.avatar%&gt;&quot;</span> <span class="keyword">class</span>=<span class="string">&quot;js-avatar show&quot;</span>&gt;</span><br><span class="line"><span class="language-xml"><span class="tag">&lt;<span class="name">img</span> <span class="attr">src</span>=<span class="string">&quot;&lt;%=theme.avatar%&gt;&quot;</span> <span class="attr">class</span>=<span class="string">&quot;js-avatar show&quot;</span> <span class="attr">style</span>=<span class="string">&quot;width: 100%;height: 100%;opacity: 1;&quot;</span>&gt;</span></span></span><br></pre></td></tr></table></figure>

<h2 id="但是点开目录之后任然头像无法显示，而且隐藏目录功能暂时无法使用，不知道为什么"><a href="#但是点开目录之后任然头像无法显示，而且隐藏目录功能暂时无法使用，不知道为什么" class="headerlink" title="但是点开目录之后任然头像无法显示，而且隐藏目录功能暂时无法使用，不知道为什么"></a>但是点开目录之后任然头像无法显示，而且隐藏目录功能暂时无法使用，不知道为什么</h2><h2 id="绝大部分功能还未实现，因为这个模板的主人6年没更新了，要自己修改…（主要挺喜欢这个主题"><a href="#绝大部分功能还未实现，因为这个模板的主人6年没更新了，要自己修改…（主要挺喜欢这个主题" class="headerlink" title="绝大部分功能还未实现，因为这个模板的主人6年没更新了，要自己修改…（主要挺喜欢这个主题"></a>绝大部分功能还未实现，因为这个模板的主人6年没更新了，要自己修改…（主要挺喜欢这个主题</h2></article><div class="post-copyright"><div class="post-copyright__author"><span class="post-copyright-meta">文章作者: </span><span class="post-copyright-info"><a href="http://leyandh.gitee.io">Leyandh</a></span></div><div class="post-copyright__type"><span class="post-copyright-meta">文章链接: </span><span class="post-copyright-info"><a href="http://leyandh.gitee.io/2023/03/22/hexo%E5%A4%B4%E5%83%8F%E6%97%A0%E6%B3%95%E6%98%BE%E7%A4%BA/">http://leyandh.gitee.io/2023/03/22/hexo%E5%A4%B4%E5%83%8F%E6%97%A0%E6%B3%95%E6%98%BE%E7%A4%BA/</a></span></div><div class="post-copyright__notice"><span class="post-copyright-meta">版权声明: </span><span class="post-copyright-info">本博客所有文章除特别声明外，均采用 <a href="https://creativecommons.org/licenses/by-nc-sa/4.0/" target="_blank">CC BY-NC-SA 4.0</a> 许可协议。转载请注明来自 <a href="http://leyandh.gitee.io" target="_blank">Blog</a>！</span></div></div><div class="tag_share"><div class="post-meta__tag-list"><a class="post-meta__tags" href="/tags/hexo/">hexo</a></div><div class="post_share"><div class="social-share" data-image="https://leyandh.gitee.io/img/maqima.jpg" data-sites="facebook,twitter,wechat,weibo,qq"></div><link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/butterfly-extsrc/sharejs/dist/css/share.min.css" media="print" onload="this.media='all'"><script src="https://cdn.jsdelivr.net/npm/butterfly-extsrc/sharejs/dist/js/social-share.min.js" defer></script></div></div><nav class="pagination-post" id="pagination"><div class="prev-post pull-full"><a href="/2023/03/24/%E5%AE%8C%E7%BE%8E%E8%A7%A3%E5%86%B3%E5%A4%B4%E5%83%8F%E9%97%AE%E9%A2%98/" title="完美解决头像问题"><div class="cover" style="background: var(--default-bg-color)"></div><div class="pagination-info"><div class="label">上一篇</div><div class="prev_info">完美解决头像问题</div></div></a></div></nav><div class="relatedPosts"><div class="headline"><i class="fas fa-thumbs-up fa-fw"></i><span>相关推荐</span></div><div class="relatedPosts-list"><div><a href="/2023/03/24/%E5%AE%8C%E7%BE%8E%E8%A7%A3%E5%86%B3%E5%A4%B4%E5%83%8F%E9%97%AE%E9%A2%98/" title="完美解决头像问题"><div class="cover" style="background: var(--default-bg-color)"></div><div class="content is-center"><div class="date"><i class="far fa-calendar-alt fa-fw"></i> 2023-03-24</div><div class="title">完美解决头像问题</div></div></a></div></div></div><hr/><div id="post-comment"><div class="comment-head"><div class="comment-headline"><i class="fas fa-comments fa-fw"></i><span> 评论</span></div></div><div class="comment-wrap"><div><div id="lv-container" data-id="city" data-uid="MTAyMC81ODI0MS8zNDcwNA=="></div></div></div></div></div><div class="aside-content" id="aside-content"><div class="card-widget card-info"><div class="is-center"><div class="avatar-img"><img src="https://leyandh.gitee.io/img/maqima.jpg" onerror="this.onerror=null;this.src='/img/friend_404.gif'" alt="avatar"/></div><div class="author-info__name">Leyandh</div><div class="author-info__description"></div></div><div class="card-info-data site-data is-center"><a href="/archives/"><div class="headline">文章</div><div class="length-num">10</div></a><a href="/tags/"><div class="headline">标签</div><div class="length-num">10</div></a><a href="/categories/"><div class="headline">分类</div><div class="length-num">0</div></a></div><a id="card-info-btn" target="_blank" rel="noopener" href="https://github.com/leyandh"><i class="fab fa-github"></i><span>Follow Me</span></a></div><div class="card-widget card-announcement"><div class="item-headline"><i class="fas fa-bullhorn fa-shake"></i><span>公告</span></div><div class="announcement_content">新添加评论功能</div></div><div class="sticky_layout"><div class="card-widget" id="card-toc"><div class="item-headline"><i class="fas fa-stream"></i><span>目录</span><span class="toc-percentage"></span></div><div class="toc-content"><ol class="toc"><li class="toc-item toc-level-1"><a class="toc-link" href="#%E8%BF%9B%E5%85%A5themes%E8%B7%AF%E5%BE%84%E4%B8%8B%E7%9A%84layout-x2F-partial-x2F"><span class="toc-number">1.</span> <span class="toc-text">进入themes路径下的layout&#x2F;_partial&#x2F;</span></a></li><li class="toc-item toc-level-1"><a class="toc-link" href="#%E4%BF%AE%E6%94%B9left-col-ejs"><span class="toc-number">2.</span> <span class="toc-text">修改left-col.ejs</span></a><ol class="toc-child"><li class="toc-item toc-level-2"><a class="toc-link" href="#%E4%BD%86%E6%98%AF%E7%82%B9%E5%BC%80%E7%9B%AE%E5%BD%95%E4%B9%8B%E5%90%8E%E4%BB%BB%E7%84%B6%E5%A4%B4%E5%83%8F%E6%97%A0%E6%B3%95%E6%98%BE%E7%A4%BA%EF%BC%8C%E8%80%8C%E4%B8%94%E9%9A%90%E8%97%8F%E7%9B%AE%E5%BD%95%E5%8A%9F%E8%83%BD%E6%9A%82%E6%97%B6%E6%97%A0%E6%B3%95%E4%BD%BF%E7%94%A8%EF%BC%8C%E4%B8%8D%E7%9F%A5%E9%81%93%E4%B8%BA%E4%BB%80%E4%B9%88"><span class="toc-number">2.1.</span> <span class="toc-text">但是点开目录之后任然头像无法显示，而且隐藏目录功能暂时无法使用，不知道为什么</span></a></li><li class="toc-item toc-level-2"><a class="toc-link" href="#%E7%BB%9D%E5%A4%A7%E9%83%A8%E5%88%86%E5%8A%9F%E8%83%BD%E8%BF%98%E6%9C%AA%E5%AE%9E%E7%8E%B0%EF%BC%8C%E5%9B%A0%E4%B8%BA%E8%BF%99%E4%B8%AA%E6%A8%A1%E6%9D%BF%E7%9A%84%E4%B8%BB%E4%BA%BA6%E5%B9%B4%E6%B2%A1%E6%9B%B4%E6%96%B0%E4%BA%86%EF%BC%8C%E8%A6%81%E8%87%AA%E5%B7%B1%E4%BF%AE%E6%94%B9%E2%80%A6%EF%BC%88%E4%B8%BB%E8%A6%81%E6%8C%BA%E5%96%9C%E6%AC%A2%E8%BF%99%E4%B8%AA%E4%B8%BB%E9%A2%98"><span class="toc-number">2.2.</span> <span class="toc-text">绝大部分功能还未实现，因为这个模板的主人6年没更新了，要自己修改…（主要挺喜欢这个主题</span></a></li></ol></li></ol></div></div><div class="card-widget card-recent-post"><div class="item-headline"><i class="fas fa-history"></i><span>最新文章</span></div><div class="aside-list"><div class="aside-list-item no-cover"><div class="content"><a class="title" href="/2023/04/16/%E8%A7%A3%E5%86%B3%E8%AF%AF%E5%88%A0-var-lib-dpkg-info-%E4%B8%8B%E7%9A%84%E6%96%87%E4%BB%B6%E7%9A%84%E5%8A%9E%E6%B3%95/" title="解决误删/var/lib/dpkg/info/下的文件的办法">解决误删/var/lib/dpkg/info/下的文件的办法</a><time datetime="2023-04-15T17:06:55.000Z" title="发表于 2023-04-16 01:06:55">2023-04-16</time></div></div><div class="aside-list-item no-cover"><div class="content"><a class="title" href="/2023/04/15/python%E5%B8%B8%E7%94%A8%E4%BB%A3%E7%A0%81/" title="python常用代码">python常用代码</a><time datetime="2023-04-14T16:19:31.000Z" title="发表于 2023-04-15 00:19:31">2023-04-15</time></div></div><div class="aside-list-item no-cover"><div class="content"><a class="title" href="/2023/04/14/%E4%BD%BF%E7%94%A8nonebot%E8%BF%87%E7%A8%8B%E4%B8%AD%E9%81%87%E5%88%B0%E7%9A%84%E9%97%AE%E9%A2%98/" title="使用nonebot过程中遇到的问题">使用nonebot过程中遇到的问题</a><time datetime="2023-04-14T15:21:02.000Z" title="发表于 2023-04-14 23:21:02">2023-04-14</time></div></div><div class="aside-list-item no-cover"><div class="content"><a class="title" href="/2023/04/14/python%E4%B8%AD%E5%B8%B8%E8%A7%81%E9%97%AE%E9%A2%98/" title="python中遇到过的问题">python中遇到过的问题</a><time datetime="2023-04-13T16:22:40.000Z" title="发表于 2023-04-14 00:22:40">2023-04-14</time></div></div><div class="aside-list-item no-cover"><div class="content"><a class="title" href="/2023/04/09/%E8%AE%B0%E9%9A%8F%E8%BA%ABwifi%E5%88%B7%E6%9C%BA/" title="记随身wifi刷机">记随身wifi刷机</a><time datetime="2023-04-08T17:06:31.000Z" title="发表于 2023-04-09 01:06:31">2023-04-09</time></div></div></div></div></div></div></main><footer id="footer"><div id="footer-wrap"><div class="copyright">&copy;2020 - 2023 By Leyandh</div><div class="framework-info"><span>框架 </span><a target="_blank" rel="noopener" href="https://hexo.io">Hexo</a><span class="footer-separator">|</span><span>主题 </span><a target="_blank" rel="noopener" href="https://github.com/jerryc127/hexo-theme-butterfly">Butterfly</a></div></div></footer></div><div id="rightside"><div id="rightside-config-hide"><button id="readmode" type="button" title="阅读模式"><i class="fas fa-book-open"></i></button><button id="darkmode" type="button" title="浅色和深色模式转换"><i class="fas fa-adjust"></i></button><button id="hide-aside-btn" type="button" title="单栏和双栏切换"><i class="fas fa-arrows-alt-h"></i></button></div><div id="rightside-config-show"><button id="rightside_config" type="button" title="设置"><i class="fas fa-cog fa-spin"></i></button><button class="close" id="mobile-toc-button" type="button" title="目录"><i class="fas fa-list-ul"></i></button><a id="to_comment" href="#post-comment" title="直达评论"><i class="fas fa-comments"></i></a><button id="go-up" type="button" title="回到顶部"><span class="scroll-percent"></span><i class="fas fa-arrow-up"></i></button></div></div><div><script src="/js/utils.js"></script><script src="/js/main.js"></script><script src="https://cdn.jsdelivr.net/npm/@fancyapps/ui/dist/fancybox.umd.min.js"></script><div class="js-pjax"><script>function loadLivere () {
  if (typeof LivereTower === 'object') {
    window.LivereTower.init()
  }
  else {
    (function(d, s) {
        var j, e = d.getElementsByTagName(s)[0];
        if (typeof LivereTower === 'function') { return; }
        j = d.createElement(s);
        j.src = 'https://cdn-city.livere.com/js/embed.dist.js';
        j.async = true;
        e.parentNode.insertBefore(j, e);
    })(document, 'script');
  }
}

if ('Livere' === 'Livere' || !false) {
  if (false) btf.loadComment(document.getElementById('lv-container'), loadLivere)
  else loadLivere()
}
else {
  function loadOtherComment () {
    loadLivere()
  }
}</script></div><script src="https://cdn.jsdelivr.net/npm/butterfly-extsrc/dist/activate-power-mode.min.js"></script><script>POWERMODE.colorful = true;
POWERMODE.shake = true;
POWERMODE.mobile = false;
document.body.addEventListener('input', POWERMODE);
</script><script async data-pjax src="//busuanzi.ibruce.info/busuanzi/2.3/busuanzi.pure.mini.js"></script></div></body></html>